package com.mdinic.blogovi.front.common.menu;

import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.markup.html.link.BookmarkablePageLink;
import org.apache.wicket.markup.html.panel.Panel;

import com.mdinic.blogovi.front.common.AjaxLinkPerson;
import com.mdinic.blogovi.front.page.forgotpass.ForgotPasswordPage;
import com.mdinic.blogovi.front.page.register.RegisterPage;
import com.mdinic.blogovi.front.page.whyjoin.WhyJoinPage;

public class TopMenu extends Panel {

    private static final String LOGIN_LINK_ID = "login_link";
    private static final String ID = "top_menu";

    private static final long serialVersionUID = 1L;

    public TopMenu() {
        super(ID);
        setOutputMarkupId(true);

        add(new AjaxLinkPerson(LOGIN_LINK_ID) {

            private static final long serialVersionUID = 1L;

            @Override
            public void click(AjaxRequestTarget target) {
                setResponsePage(getPage().getClass());
            }

        });

        add(new BookmarkablePageLink<RegisterPage>("reg_link", RegisterPage.class));
        add(new BookmarkablePageLink<ForgotPasswordPage>("forgot_link", ForgotPasswordPage.class));
        add(new BookmarkablePageLink<WhyJoinPage>("why_join_link", WhyJoinPage.class));
    }

}
